
package site.codeyin.javautils.utils.guava;

import cn.hutool.core.lang.TypeReference;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;

import java.util.ArrayList;
import java.util.Map;

/**
 * @author <a href="https://github.com/liangcheng2221">yinjie</a>
 * @date 2024-09-08 10:58
 */
public class MapMain {
    public static void main(String[] args) {
        ArrayList<Integer> arrayList = Lists.newArrayList();
        String jsonString = JSON.toJSONString(ImmutableMap.of("yinjie", "yinije"));

        Map<String,String> map = JSONUtil.toBean(jsonString,new TypeReference<Map<String,String>>(){},true);

        System.out.println(map);
    }
}
